package com.fun.feifun.modules.sys.auth.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fun.feifun.base.BaseEntity;
import com.fun.feifun.modules.sys.auth.model.dto.MenuTree;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 系统菜单
 * </p>
 *
 * @author wkf
 * @since 2022-04-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="SysMenu对象", description="系统菜单")
public class SysMenu extends BaseEntity implements Serializable    {

    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "标题")
    private String title;

    @ApiModelProperty(value = "路径")
    private String route;

    @ApiModelProperty(value = "图标")
    private String icon;

    @ApiModelProperty(value = "模块id")
    private Long modularId;

    @ApiModelProperty(value = "父菜单ID")
    private Long parentId;

	@ApiModelProperty(value = "租户ID")
	private Long tenantId;

	@ApiModelProperty(value = "排序")
	private Integer sort;

	@ApiModelProperty(value = "类型 0目录，1菜单，2按钮（权限）",required =true, example ="0")
	private Integer type;

	@ApiModelProperty(value = "权限关键词")
	private String permit;


    public MenuTree toMenuTree(){
        MenuTree menuTree = new MenuTree();
        BeanUtils.copyProperties(this,menuTree);
        return menuTree;
    }

}
